<script type="text/javascript">
	$(document).ready(function() {
		
		$('#parent').change(function(event) {
			try{
				//console.log(substring($('#parent').val(), 1, 1));
				$('#kode_akun_1').val($('#parent').val().substr(0, 1));
			}catch(e){
				$('#kode_akun_1').val('');
				console.log(e);
			}
		});

	});
</script>

<form id="form1" method="post" style="margin:10px;">
	<input name="kode" value="<?=$kode_akun?>" type="hidden">
	<div class="fitem" <?=$aksi=='edit'? 'style="display:none;"' : '' ?> >
		<label style="width:120px">Tipe Akun </label>:
		<input type="radio" name="tipe" value="H" <?=$tipe=='H' ? 'checked' : '' ?> >&nbsp;Header
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="radio" name="tipe" value="P" <?=$tipe=='P' ? 'checked' : '' ?>>&nbsp;Posting
	</div>
	<div class="fitem" >
		<label style="width:120px">Simpan Dibawah</label>:
		<select name="parent" id="parent">
			<?=$this->mdl_prosedur->option_akun(array('value'=>$parent, 'tipe'=>'H', 'kode_awal'=>$kode_akun_1))?>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:120px">Kode Akun</label>:
		<input name="kode_akun_1" id="kode_akun_1" style="width: 30px" readonly="readonly" value="<?=$kode_akun_1?>">
		-
		<input name="kode_akun_2" style="width: 100px" maxlength="4" value="<?=$kode_akun_2?>">
	</div>
	<div class="fitem" >
		<label style="width:120px">Deskripsi</label>:
		<textarea name="deskripsi" cols="30" rows="3"><?=$deskripsi?></textarea>
	</div>
</form>
	

